import os
import sys

def dps(s):
    dp = [0] * len(s)
    dp[0] = ord(s[0]) - 96

    if len(s) == 1:
        return dp[-1]

    dp[1] = max(ord(s[0]) - 96, ord(s[1]) - 96)
    for i in range(2, len(s)):
        dp[i] = max(dp[i - 1], dp[i - 2] + (ord(s[i])) - 96)
        # 因为 [松散: P(i) - P(i-1) >= 2] -> [松散: P(i-1) <= P(i) - 2]
    return dp[-1]


if __name__ == '__main__':
    s = input()
    print(dps(s))